package com.fulihui.weixinsdk.util;

import com.fulihui.weixinsdk.result.WeixinResult;

/**
 * 微信接口返回工具
 * Created by Willard.Hu on 2016/3/5.
 */
public class WxSDKResultUtil {

    /**
     * 检查微信json数据格式的返回结果
     */
    public static void checkResult(WeixinResult result) {
        if (result == null) {
            throw new WxSDKResultException("null", "result is null");
        }
        if (!result.isSuccess()) {
            throw new WxSDKResultException(result.getErrcode(), result.getErrmsg());
        }
    }
}
